import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import AdminIndex from '@/components/admin-index.vue'
import Login from '@/components/auth/login.vue';
Vue.use(VueRouter)
const routes: Array<RouteConfig> = [
      {
        path: '/',
        name: 'AdminIndex',
        component: AdminIndex,
        meta: {
          title: '管理员首页'
        },
        children: [
            {
                path: '/productList',
                name: 'productList',
                component: () => import(/* webpackChunkName: "productList" */ '@/components/product-manager/product-list.vue'),
                meta: {keepAlive: false,title:"商品列表"},
            },
            {
                path: '/orderList',
                name: 'orderList',
                component: () => import(/* webpackChunkName: "orderList" */ '@/components/order-manager/order-list.vue'),
                meta: {keepAlive: false,title:"订单列表"},
            },
            {
                path: '/userList',
                name: 'userList',
                component: () => import(/* webpackChunkName: "productList" */ '@/components/user-manager/user-list.vue'),
                meta: {keepAlive: false,title:"用户列表"},
            },
            {
                path: '/logList',
                name: 'logList',
                component: () => import(/* webpackChunkName: "productList" */ '@/components/log-manager/log-list.vue'),
                meta: {keepAlive: false,title:"日志列表"},
            },
            {
                path: '/wareHouseList',
                name: 'wareHouseList',
                component: () => import(/* webpackChunkName: "productList" */ '@/components/warehouse-manager/warehous-list.vue'),
                meta: {keepAlive: false,title:"待发货商品"},
            }
         ]
      },
      {
        path: '/login',
        name: 'Login',
        component: Login,
        meta: {
            keepAlive: false,
            title:"登录页面"
        }
      },
]

const router = new VueRouter({
      mode: 'history',
      base: process.env.BASE_URL,
      routes
})

export default router
